package com.csun.cmny.provider.model.service;

import com.csun.cmny.provider.model.dto.user.OmcUserQueryDto;
import com.csun.cmny.provider.model.dto.user.UserRoleDto;
import com.csun.cmny.provider.model.service.hystrix.UacUserFeignApiHystrix;
import com.csun.cmny.provider.model.vo.OmcUserVo;
import com.csun.cmny.provider.model.vo.OpcUserVo;
import com.csun.cmny.provider.model.vo.RpcMerchantVO;
import com.csun.cmny.provider.model.vo.RpcUserVo;
import com.csun.cmny.security.feign.OAuth2FeignAutoConfiguration;
import com.csun.cmny.util.wrapper.Wrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List; /**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-06-04 21:38
 * @Description: the class interface uac user feign api
 */
@FeignClient(value = "cmny-provider-uac", configuration = OAuth2FeignAutoConfiguration.class, fallback = UacUserFeignApiHystrix.class)
public interface UacUserFeignApi {

    @PostMapping("/api/uac/user/queryUserListByUserIds")
    Wrapper<List<RpcUserVo>> queryUserListByUserIds(@RequestBody List<Long> userList);

    @PostMapping("/api/uac/user/queryOmcUserListByUserIds")
    Wrapper<List<OmcUserVo>> queryOmcUserListByUserIds(@RequestBody List<Long> userList);

    @PostMapping("/api/uac/user/queryOmcUserListByQueryDto")
    Wrapper<List<OmcUserVo>> queryOmcUserListByQueryDto(@RequestBody OmcUserQueryDto omcUserQueryDto);

    /**
     * 查询机构下未绑定的护工
     * @param userList
     * @return
     */
    @PostMapping("/api/uac/user/queryOmcUnUnrsingUserListByUserIds")
    Wrapper<List<OmcUserVo>> queryOmcUnUnrsingUserListByUserIds(@RequestBody List<Long> userList, @RequestParam("goupId") Long goupId , @RequestParam("roleCode") String roleCode);

    @PostMapping("/api/uac/user/queryUserListByRoleCodeAndGroupId")
    Wrapper<List<RpcUserVo>> queryUserListByRoleCodeAndGroupId(@RequestBody UserRoleDto userRoleDto);

    @PostMapping("/api/uac/user/queryOpcUserVoByUserId")
    Wrapper<OpcUserVo> queryOpcUserVoByUserId(@RequestParam("userId") Long userId);

    @PostMapping("/api/uac/user/queryMerchantListByUserIds")
    Wrapper<List<RpcMerchantVO>> queryMerchantListByIdList(@RequestBody List<Long> userList);
}
